-
Notifications
You must be signed in to change notification settings - Fork 388
Monetizable: Skip subunit write for non-attributes in getter #706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2ca99c0
to
fbc4f21
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Could you add a small entry to the Changelog as well? 🙏🏻
@yukideluxe, hope you don't mind me @'ing you directly. First off, thanks for all you do on Money Rails. It's a wonderful tool. Is there anything we can to help move this PR to be ready for the Money Rails team review? The work you all do is truly valuable so we want to make sure we're not wasting your time. Also, is there anything generally that we can do to help the team be more effective? |
Hi @wwahammy! You can ping me anytime! Sorry, it's been a crazy August 😳 I will review and merge the PR ASAP! 💪🏻 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Thanks for the fix!
Nothing to apologize for at all, @yukideluxe. The work you do is awesome and we're all incredibly thankful. If there's anything any of us can do to chip in and help, let us know. |
Discovered an issue where making an update to instance currencies causes a MissingAttributeError for converted methods
Example model:
Triggering the error:
This occurs because of a condition in
read_monetized
that tries to update the attribute if the currency changes. This case is needed for maintaining persisted values if the currency changes in a way that the subunit to unit ratio also changes. (This logic is also referred to as being controversial in the TODO comment on the test coverage)Regardless, the attempt to update the attribute fails for monetized methods because there is no attribute to update. So I added a condition to check for the attribute's presence.